<template>
    <van-nav-bar
        title="商品详情"
        left-text="返回"
        left-arrow
        @click-left="bindBack"
    />
    <div>
        <img :src="goods.picture" style="width:100%;height:200px;" :alt="goods.picture">
        <h2>商品名称: {{goods.product}}</h2>
        <p>商品价格: {{goods.price}}</p>
        <van-button  type="primary" @click="bindAddCart">加入购物车</van-button>
        <van-button type="success">查看购物车</van-button>
        <p>我是文志强写的代码</p>
    </div>

</template>

<script setup lang="ts">
import { useDetail } from '@/hooks/detail'
const { bindBack,goods,bindAddCart } = useDetail()

</script>

<style scoped></style>
